package org.racsor.cc.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class RequestCC {
    @Override
    public String toString() {
	return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE)
    private Long id;

    @Persistent
    private User author;

    @Persistent
    private String url;
    @Persistent
    private String parameters;
    @Persistent
    private String cookies;

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Persistent
    private String contentType;
    @Persistent
    private long size;
    @Persistent
    private String fileName;

    @Persistent
    private Date date;

    @Persistent
    private BlobKey blob;

    public BlobKey getBlob() {
	return blob;
    }

    public void setBlob(BlobKey blob) {
	this.blob = blob;
    }

    public RequestCC(User author, String url, Date date) {
	this.author = author;
	this.url = url;
	this.date = date;
    }

    public Long getId() {
	return id;
    }

    public User getAuthor() {
	return author;
    }

    public String getUrl() {
	return url;
    }

    public Date getDate() {
	return date;
    }

    public void setAuthor(User author) {
	this.author = author;
    }

    public void setUrl(String url) {
	this.url = url;
    }

    public void setDate(Date date) {
	this.date = date;
    }

    public String getParameters() {
	return parameters;
    }

    public void setParameters(String parameter) {
	this.parameters = parameter;
    }

	public String getCookies() {
		return cookies;
	}

	public void setCookies(String cookies) {
		this.cookies = cookies;
	}
}
